﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using CPETwit.WPFClient.Business.TwitterServiceReference;
using CPETwit.WPFClient.Common;

namespace CPETwit.WPFClient.Converter
{
    public class FollowedContentConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is User && CommonData.LOGGED_USER != null)
            {
                User user = value as User;
                return CommonData.IsFollowed(CommonData.LOGGED_USER, user) ?
                    "Se désabonner" :
                    "S'abonner";
            }
            return "Etat inconnu";
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
